<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="./js/jquery-1.12.3.js"></script>
    <script src="./js/jquery.idcode.js"></script>
    <link rel="stylesheet" href="./css/jquery.idcode.css">
</head>

<body>
    <input type="text" id="Txtidcode" class="txtVerification"><span id="idcode"></span>
    <input type="button" id="butn" value="提交">
</body>
<script>
    $(function () {
        $.idcode.setCode(); //加载生成验证码方法

        $("#butn").click(function () {
            var IsBy = $.idcode.validateCode() //调用返回值，返回值结果为true或者false
            if (IsBy) {
                alert("ok")
            } else {
                alert("no_ok")
            }
        })
    })
</script>

</html>